package com.yuanfeng.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuanfeng.commoms.vo.order.InvoiceEntityInfoVO;
import com.yuanfeng.order.entity.OrderInvoiceInfoEntity;
import com.yuanfeng.order.vo.OrderInvoiceDetailVO;
import com.yuanfeng.order.vo.PlatformOrderInvoiceDetailVO;
import com.yuanfeng.order.vo.PlatformOrderInvoiceVO;
import com.yuanfeng.order.vo.SellerOrderInvoiceDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @ClassName OrderInvoiceInfoMapper
 * @Description 订单发票表
 * @Author cyp
 * @Date 2023-05-31 11:59:35
 * @Version 1.0
 **/
@Mapper
public interface OrderInvoiceInfoMapper extends BaseMapper<OrderInvoiceInfoEntity> {


    void addInvoiceInfo(@Param("param")InvoiceEntityInfoVO invoiceInfo);

    /**
     * 查看申请发票状态
     * @param orderId
     * @return
     */
    Integer getInvoiceStatus(@Param("orderId")String orderId);

    /**
     * 查询订单实付价
     * @param param
     * @return
     */
    BigDecimal getInvoiceAmount(@Param("param")Map<Object, Object> param);

    /**
     * 根据订单号查询发票id
     * @param param
     * @return
     */
    Integer getInvoiceId(@Param("param") Map<Object, Object> param);

    /**
     * 修改发票状态
     * @param param
     */
    void updateInvoiceInfo(@Param("param") Map<Object, Object> param);

    /**
     * 新增发票信息
     *
     * @param param
     */
    void insertInvoiceInfo(@Param("param") Map<Object, Object> param);

    /**
     * 修改订单发票状态
     * @param param
     */
    void updateInvoiceStatus(@Param("param") Map<Object, Object> param);

    /**
     * 查询发票详情
     *
     * @param param
     * @return
     */
    OrderInvoiceDetailVO queryInvoiceDetail(@Param("param") Map<Object, Object> param);

    /**
     * 查询发票订单
     *
     * @param param
     * @return
     */
    IPage<PlatformOrderInvoiceVO> queryPlatformOrderInvoiceInfo(IPage<PlatformOrderInvoiceVO> page,@Param("param") Map<String, Object> param);

    /**
     * 平台查看发票详情
     */
    PlatformOrderInvoiceDetailVO queryPlatformInvoiceDetail(@Param("param") Map<Object, Object> param);

    /**
     * 修改审核状态和审核备注信息
     * @param param
     */
    void auditInvoiceForSeller(@Param("param") Map<Object, Object> param);

    /**
     * 修改发票状态
     * @param param
     */
    void updateOrderInvoiceStatus(@Param("param") Map<Object, Object> param);

    /**
     * 查询卖家发票详细信息
     * @param param
     * @return
     */
    SellerOrderInvoiceDetailVO querySellerInvoiceDetail(@Param("param") Map<Object, Object> param);
}
